var pattern1 = /[\u4e00-\u9fa5]+/g;
// 3泛型函数重载准备
// (1). 中文排序
// (2). 自排序
function quickSort(arr) {
    if (arr.length < 2) {
        return arr;
    }
    var left = [];
    var right = [];
    var mid = arr.splice(Math.floor(arr.length / 2), 1)[0];
    console.log('mid:', mid);
    for (var i = 0; i < arr.length; i++) {
        if (arr[i] < mid) {
            left.push(arr[i]);
        }
        else {
            right.push(arr[i]);
        }
    }
    return quickSort(left).concat(mid, quickSort(right));
}
// localeCompare
var chineseArr = ['武汉', '郑州', '太原', '济南', '沈阳', '大连'];
// (1). 中文排序
function sortChinese(arr) {
    //Array<T>=T[]
    return arr.sort(function (firstnum, secondnum) {
        return firstnum.localeCompare(secondnum, 'zh-CN');
    });
}
console.log(sortChinese(chineseArr));
// export {}
